// Copyright 2019 The rhyme_lph Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// f [author] rhyme_lph
// N [email]  rhymelph@gmail.com
// A [github] https://github.com/rhymelph

import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/widgets/common/my_web_view.dart';
import 'package:flutter/material.dart';
import 'package:finance_app/src/provider/web_view_provider.dart';
import 'package:finance_app/src/router_gen/router_meta.dart';

@RouterMeta(paramName: "webViewPage")
class WebViewPage extends StatefulWidget {
  final String url;
  final String title;
  final bool isAdd;

  const WebViewPage({Key key, this.url, this.title, this.isAdd})
      : super(key: key);
  @override
  _WebViewPageState createState() => _WebViewPageState();
}

class _WebViewPageState extends State<WebViewPage>
    with PagePresenter<WebViewPage, WebViewProvider> {
  @override
  void initState() {
    super.initState();
    provider.isAdd = widget.isAdd;
  }

  @override
  Widget get buildWidget => MyWebView(
        url: widget.url,
        title: widget.title,
        isHiddenTittle: false,
        isShowProgress: true,
      );
}
